home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 4⁄27⁄90 / 1199-Changing cursors-Apr90 < prev    next >
Encoding:
Text File  |  1990-04-27  |  1.6 KB  |  51 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    5412635                         24-April-90        22:53DST
  4.  
  5. From:   UK0392                          EHN & DIJ Oakley,IDV
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Changing cursors
  10.  
  11. Friends,
  12.  
  13. In the course of implementing my scalable views stuff, I wanted to change the
  14. cursor (e.g. to a magnifying glass) when the user presses just (repeat JUST)
  15. the Option key, so that with said key pressed, a mouse click will fire off a
  16. ZoomCommand object.
  17.  
  18. This has transpired to be rather messy, and I wonder if anyone can suggest a
  19. neater way of doing it.
  20.  
  21. Because holding JUST the option key down does not generate an event (tut,
  22. tut!), I have had to insert this little bit into MyApplication.GetEvent:
  23.  
  24.    GetEvent := INHERITED GetEvent(eventMask, sleep, cursorRgn, anEvent);
  25.    GetKeys(aKeyMap);
  26.    IF (aKeyMap[$3A]) THEN gZoomingCmd := cZoomSpotIn {…}
  27.  
  28. which sets a global which the view's DoSetCursor uses to change cursors with.
  29.  
  30. However, unless the mouse is moved OFF the view and back on again, DoSetCursor
  31. is not called.  So what I have had to kludge is:
  32.  
  33.    gDocList.Each(CheckCurs);
  34.  
  35. in my GetEvent, calling:
  36.  
  37.    PROCEDURE CheckCurs(aDocument: TDocument);
  38.    BEGIN
  39.    IF (TPanlDocument(aDocument).fPanlGWindow = GetFrontWindow) THEN
  40.         {try to save a bit of time here by just going for the front window}
  41.    IF TPanlDocument(aDocument).fPanlGView.DoSetCursor(aPt, aCR) THEN ;
  42.    END;
  43.  
  44. This of course carries a not insignificant overhead, and results in loss of
  45. MacApp's lovely cursor setting mechanism.
  46.  
  47. Suggestions would be *most* welcome, please.
  48.  
  49. Howard.
  50.  
  51.